define(['hammer','zepto'], function() {
	var adds = $('.add');
	var reduces = $('.reduce');
	var numTexts = document.getElementsByClassName('numText');
	var numTextVal = parseInt($('.numText').val());
	var Recharge = $('#Recharge');
	var paid = $('#paid');
	var r , p;
	function Settlement(){
		r = numTexts[0].value *100+numTexts[1].value *300+numTexts[2].value *500+numTexts[3].value *1000
		p = numTexts[0].value *100+numTexts[1].value *297+numTexts[2].value *490+numTexts[3].value *980
		Recharge.text('￥' + r);
		paid.text('￥' + p);
	}
	adds.each(function(i, v) {
		new Hammer(v).on('tap', function() {
			numTexts[i].value = parseInt(numTexts[i].value) + 1;
			Settlement();
		})
	})
	reduces.each(function(i, v) {
		new Hammer(v).on('tap', function() {
			if(numTexts[i].value<=0){}else{
				numTexts[i].value = parseInt(numTexts[i].value) -1;
				Settlement();
			}
		})
	})
	
	
})